Repository navigation
fix: remove three dead ends when switching from the App Store build - #479
Merged
Merged
Conversation
The flow review of the App Store to direct switch found three places where the direct build stops with no message: - An App Store copy that is running (often a login item) made the direct build's single-instance guard quit silently, so none of the switch offers ran. The direct build now asks "Hidden Bar from the App Store is running. Quit it and switch to this version?". Quit and Switch terminates it (then forces it after 5 s) and launching continues; Cancel quits as before. Another direct copy still wins silently. A copy counts as the App Store build when its bundle has _MASReceipt/receipt or a Mac App Store signature. - "Not now" to the Trash offer left the App Store copy in /Applications, and the move offer never showed. The move offer no longer depends on it; it also waits for the Trash to finish, so a trashed copy frees /Applications. - When /Applications is not writable, or holds the App Store copy the user kept, the move goes to ~/Applications (created when missing). When neither folder can take it, an alert says plainly what to do. The decisions are pure functions (OtherRunningCopy.decide, MoveToApplications.plan) with unit tests that fail under the old rules. Debug builds get a -debugAnswerAlerts hook so a harness can answer the alerts without pointer or key input.
On macOS 27, a Debug-Direct build run from ~/Applications lost its arrow on collapse, the same as a build run from a build folder. Tested with the hooks harness, install-location check on: arrow EMPTY, held=True, placed far left like an app the system does not know. So ~/Applications is not a fix: - The move offer no longer targets ~/Applications. When /Applications is not writable, or holds the App Store copy the user kept, a one-time alert says what to do. - NativeVisibilityEngine.isInApplicationsFolder checks /Applications only, so a copy in ~/Applications fails open instead of losing its arrow. - The other-copy check reads the bundle from the executable path: with two bundles under one id, NSRunningApplication.bundleURL can name the other copy. - -debugAnswerAlerts now names alerts (switch=first,...); every alert not named is aborted, so a harness answer can never move or trash an app.
tieubao
added a commit
that referenced
this pull request
Nov 15, 2026
This was referenced Nov 15, 2026
Closed
Merged
tieubao
added a commit
that referenced
this pull request
Nov 15, 2026
MARKETING_VERSION 1.12.0 and CURRENT_PROJECT_VERSION 19 in all 8 app configurations (Direct x4, App Store x4). CHANGELOG: the Unreleased section becomes v1.12.0 (2026-11-15) and folds in the unshipped 1.11.3 entry (#475, #474, #479); there is no separate 1.11.3 section. The microphone checkbox is named as the redesigned Settings window labels it. RUNBOOK: step 5 uploads a byte-identical Hidden-Bar-macos.zip, so releases/latest/download/Hidden-Bar-macos.zip stays stable (carried over from #476).
tieubao
added a commit
that referenced
this pull request
Nov 15, 2026
MARKETING_VERSION 1.12.0 and CURRENT_PROJECT_VERSION 19 in all 8 app configurations (Direct x4, App Store x4). CHANGELOG: the Unreleased section becomes v1.12.0 (2026-11-15) and folds in the unshipped 1.11.3 entry (#475, #474, #479); there is no separate 1.11.3 section. The microphone checkbox is named as the redesigned Settings window labels it. RUNBOOK: step 5 uploads a byte-identical Hidden-Bar-macos.zip, so releases/latest/download/Hidden-Bar-macos.zip stays stable (carried over from #476).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The flow review of the App Store to direct switch found three dead ends left after #474 and #475. In each one the direct build stops and says nothing. This lands before 1.11.3 (#476 rebases on it).
What (direct build only,
#if HIDDENBAR_NATIVE_VISIBILITY)OtherRunningCopy.decidereplaces the silent quit in the direct build. An App Store copy is a bundle with_MASReceipt/receipt, or one with a Mac App Store signature (leaf OID1.2.840.113635.100.6.1.9) when the receipt is missing. The bundle is taken from the process's executable path. With two bundles under one id,NSRunningApplication.bundleURLnamed the wrong copy in the harness. When a direct copy is also running, it still wins silently. The App Store build keeps the old guard.MoveToApplications.planno longer goes silent when the App Store copy holds/Applications/Hidden Bar.app. The move check also runs afterNSWorkspace.recyclecompletes, so a copy that was just trashed frees/Applications. Before, the check could run before the Trash finished./Applicationsis not writable, or holds the App Store copy the user kept, a one-time alert gives the steps in plain words. For the same reason,NativeVisibilityEngine.isInApplicationsFolder(fix: a microphone in use no longer blocks hiding (1.11.2 regression) #475) now accepts/Applicationsonly. A copy in~/Applicationsfails open (hides nothing, keeps its arrow) and gets the move offer.Debug builds get
-debugAnswerAlerts switch=first,move=second(alert ids: switch, import, trash, move, explain, error). Each named alert takes its answer after 3 s. Any alert not named is aborted, which records nothing. Like-forceAppStoreMigration, it is Debug only.Proof
AppStoreMigrationTests(fake running-app list, fake paths, fake writability, a fake /Applications on disk), replacingtestMoveOfferRules; all passtestRunningAppStoreCopyIsOfferedAQuit,testRunningDirectCopyStillWinsSilently,testDebugRulesOnlyCountTheSamePathUnlessForced,testKeptAppStoreCopyInApplicationsExplainsWhatToDo,testUnwritableApplicationsExplainsWhatToDo,testMovePlanReadsTheFolderAndTheKeptAppStoreCopyscripts/test.shinstall-location-check on)~/Applications: arrow EMPTY after collapse,state=collapsed held=True, placed far left (x 723) like an unknown app. Same build from the scratchpad: EMPTY. Verdict: not honoured._MASReceipt/receipt)quitInFavorOf). Release-Direct develop: exits silently next to the App Store copy (the bug). Release-Direct on this branch: stays up on the alert (screenshot below).Alert copy as captured: "Hidden Bar from the App Store is running. Quit it and switch to this version?" / "Only one Hidden Bar can run at a time. The App Store version stays installed until you choose otherwise." / [Quit and Switch] [Cancel].
Not in this PR
openor at login was not tested from ~/Applications.